package com.kirin.api.response;

import lombok.Data;

/**
 * Created by gong.libin on 2018/01/01.
 * HTTP应答报文Content部分采用JSON进行序列化
 */

@Data
public class KrnResponse<T> {
    public int      code;
    public String   text;
    public T        data;

    static public KrnResponse KRN_SUCCESS = new KrnResponse();
    static public KrnResponse KRN_FAILURE = new KrnResponse(500, "系统错误");

    public KrnResponse() {
        this.code = 0;
        this.text = "OK";
    }

    public KrnResponse(int code, String text) {
        this.code = code;
        this.text = text;
    }

    public KrnResponse(int code, String text, T data) {
        this.code = code;
        this.text = text;
        this.data = data;
    }
}